package com.safe.first.domain.order.service.impl;

import com.safe.first.domain.order.model.vo.PriceItem;
import com.safe.first.domain.order.service.OrderPriceService;
import com.safe.first.domain.spu.Sku;
import com.safe.first.domain.user.User;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.stream.Collectors;

/**
 * @author Mickey
 * @since 2022/5/28
 **/
@Service
public class OrderPriceServiceImpl implements OrderPriceService {

    @Override
    public void price(List<Long> skuIds) {

    }

    @Override
    public <T extends Sku> List<PriceItem> price(List<T> skus, User user) {
        return skus.stream().map(sku -> converter()).collect(Collectors.toList());
    }


    @Override
    public <T> void price(T t) {
        System.out.println(t);
    }

    public PriceItem converter() {
        PriceItem priceItem = new PriceItem();
        priceItem.setDesc("dd");
        return priceItem;
    }
}
